/* Copyright (C) Abu Rizal, 2009.
 * 
 * This file is part of QurText.
 * 
 * QurText is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * QurText is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with QurText. If not, see <http://www.gnu.org/licenses/>.
 */
package qurtext.domain;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.Text;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Verse {

	@SuppressWarnings("unused")
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	
	@Persistent
	private Section section;
	
	@Persistent
	private Integer chapterNo=0;
	
	@Persistent
	private Integer verseNo=0;
	
	@Persistent
	private Text text;

	@Persistent
	private Text uthmani;

	@Persistent
	private Text literal;

	@Persistent
	private Text transliteration;

	@Persistent
	private Text translation;

	@Persistent
	private String topics;

	public void setSection(Section section) {
		this.section = section;
	}

	public Section getSection() {
		return section;
	}

	public int getChapterNo() {
		return chapterNo;
	}

	public void setChapterNo(int chapterNo) {
		this.chapterNo = chapterNo;
	}

	public int getVerseNo() {
		return verseNo;
	}

	public void setVerseNo(int verseNo) {
		this.verseNo = verseNo;
	}

	public String getText() {
		return text.getValue();
	}

	public void setText(String text) {
		this.text = new Text(text);
	}

	public void setTransliteration(String transliteration) {
		this.transliteration = new Text(transliteration);
	}

	public String getTransliteration() {
		return transliteration.getValue();
	}

	public void setTranslation(String translation) {
		this.translation = new Text(translation);
	}

	public String getTranslation() {
		return translation.getValue();
	}

	public void setLiteral(String literal) {
		this.literal = new Text(literal);
	}

	public String  getLiteral() {
		if (null==literal) literal=new Text(text.getValue());
		return literal.getValue();
	}

	public void setTopics(String topics) {
		this.topics = topics;
	}

	public String getTopics() {
		return topics;
	}

	public String getUthmani() {
		if (null==uthmani) return null;
		return uthmani.getValue();
	}

	public void setUthmani(String uthmani) {
		this.uthmani = new Text(uthmani);
	}

}
